package com.ruoyi.fire.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.fire.mapper.FireDispatchMapper;
import com.ruoyi.fire.domain.FireDispatch;
import com.ruoyi.fire.service.IFireDispatchService;

/**
 * 出警Service业务层处理
 * 
 * @author ruoyi
 * @date 2023-06-13
 */
@Service
public class FireDispatchServiceImpl implements IFireDispatchService 
{
    @Autowired
    private FireDispatchMapper fireDispatchMapper;

    /**
     * 查询出警
     * 
     * @param id 出警主键
     * @return 出警
     */
    @Override
    public FireDispatch selectFireDispatchById(Long id)
    {
        return fireDispatchMapper.selectFireDispatchById(id);
    }

    /**
     * 查询出警列表
     * 
     * @param fireDispatch 出警
     * @return 出警
     */
    @Override
    public List<FireDispatch> selectFireDispatchList(FireDispatch fireDispatch)
    {
        return fireDispatchMapper.selectFireDispatchList(fireDispatch);
    }

    /**
     * 新增出警
     * 
     * @param fireDispatch 出警
     * @return 结果
     */
    @Override
    public int insertFireDispatch(FireDispatch fireDispatch)
    {
        fireDispatch.setCreateTime(DateUtils.getNowDate());
        return fireDispatchMapper.insertFireDispatch(fireDispatch);
    }

    /**
     * 修改出警
     * 
     * @param fireDispatch 出警
     * @return 结果
     */
    @Override
    public int updateFireDispatch(FireDispatch fireDispatch)
    {
        fireDispatch.setUpdateTime(DateUtils.getNowDate());
        return fireDispatchMapper.updateFireDispatch(fireDispatch);
    }

    /**
     * 批量删除出警
     * 
     * @param ids 需要删除的出警主键
     * @return 结果
     */
    @Override
    public int deleteFireDispatchByIds(Long[] ids)
    {
        return fireDispatchMapper.deleteFireDispatchByIds(ids);
    }

    /**
     * 删除出警信息
     * 
     * @param id 出警主键
     * @return 结果
     */
    @Override
    public int deleteFireDispatchById(Long id)
    {
        return fireDispatchMapper.deleteFireDispatchById(id);
    }
}
